package com.superman.supermarket.client.widget.button;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Image;
import com.superman.mvpframe.client.gin.XGinjector;
import com.superman.supermarket.client.gin.ShopGinjector;

/**
 * 我的头像按钮
 * 
 * @author superman
 * @version 2018年8月2日下午9:49:29
 */
public class MyHeaderButton extends Image {

	/**
	 * 构造方法
	 * 
	 * @author superman
	 * @version 2018年8月2日 下午9:50:18
	 */
	public MyHeaderButton() {
		this.setUrl(XGinjector.INSTANCE.getUserModel().getIcon());
		this.setSize("0.64rem", "0.64rem");
		this.getElement().getStyle().setProperty("borderRadius", "50%");
		this.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				XGinjector.INSTANCE.getMyPlaceController().push(ShopGinjector.INSTANCE.getMyPlaceFactory().getPersonPlace());
			}
		});
	}

}
